package com.erclab.internal.xpresso.security;

import org.apache.log4j.Logger;

import com.erclab.internal.xpresso.exceptions.DirectoryException;

public class SimpleUserDirectory implements UserDirectory {

	private static final Logger log = Logger.getLogger(SimpleUserDirectory.class);
	
	public void addRoleToUser(User user, String roleName)
			throws DirectoryException {
		// The Simple User Directory does not support roles.
	}

	public void addVisitEntry(User user) throws DirectoryException {
		log.info("New user visit: " + user.getUserName());

	}

	public void loadUserBean(User user) throws DirectoryException {
		if (user == null){
			user = new User();
		}
		user.setUserName("guest");
		user.setNetId("guest");
	}

}
